package org.dromara.vehicle.modules.carApply.domain.vo;

import cn.hutool.core.date.DatePattern;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import org.dromara.common.translation.annotation.Translation;
import org.dromara.common.translation.constant.TransConstant;
import org.dromara.vehicle.modules.carApply.domain.CarApply;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;


/**
 * 用车申请视图对象 car_apply
 *
 * @author ckk
 * @date 2025-06-27
 */
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = CarApply.class)
public class CarApplyVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @ExcelProperty(value = "主键")
    private Long id;

    /**
     * 用车事由
     */
    @ExcelProperty(value = "用车事由", converter = ExcelDictConvert.class)
    @ExcelDictFormat(dictType = "ycsy")
    private Integer useReason;

    /**
     * 用车类型
     */
    @ExcelProperty(value = "用车类型", converter = ExcelDictConvert.class)
    @ExcelDictFormat(dictType = "clxh")
    private Integer carType;

    /**
     * 预计用车开始时间
     */
    @ExcelProperty(value = "预计用车开始时间")
    private Date startTime;

    /**
     * 预计用车结束时间
     */
    @ExcelProperty(value = "预计用车结束时间")
    private Date endTime;

    /**
     * 用车地点
     */
    @ExcelProperty(value = "用车地点")
    private String usePlace;

    /**
     * 预估里程数(km)
     */
    @ExcelProperty(value = "预估里程数(km)")
    private Integer estimatedMileage;

    /**
     * 预计费用(元)
     */
    @ExcelProperty(value = "预计费用(元)")
    private BigDecimal estimatedCost;

    /**
     * 附件
     */
    @ExcelProperty(value = "附件")
    private String attachment;

    /**
     * 审批状态
     */
    @ExcelProperty(value = "审批状态", converter = ExcelDictConvert.class)
    @ExcelDictFormat(dictType = "ywzt")
    private String status;

    /**
     * 审批状态
     */
    @Translation(type = TransConstant.DICT_TYPE_TO_LABEL, mapper = "status", other = "ywzt")
    private String statusName;

    /**
     * 申请人ID
     */
    @ExcelProperty(value = "申请人ID")
    private Long createBy;

    /**
     * 申请人
     */
    @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "createBy")
    private String createName;

    /**
     * 创建时间
     */
    @ExcelProperty(value = "创建时间")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_MINUTE_PATTERN)
    private Date createTime;


}
